<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>Book管理</title>
	<meta name="decorator" content="default"/>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/book/">Book列表</a></li>
		<li><a href="${ctx}/book/form">Book添加</a></li>
	</ul>
	<form:form id="searchForm" modelAttribute="book" action="${ctx}/book/" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<ul class="ul-form">
			<li><label>书名：</label>
				<form:input path="bookname" htmlEscape="false" maxlength="64" class="input-medium"/>
			</li>
			<li><label>作者：</label>
			<form:input path="author" htmlEscape="false" maxlength="64" class="input-medium"/>
			<!--  
				<select name="age">
					<option value="">全部</option>					
					<option value="1">默认状态</option>
					<option value="2">启用</option>
					<option value="3">禁用</option>	
				</select>
			-->
			</li>
			<li class="btns"><input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/></li>
			<li class="clearfix"></li>
		</ul>
	</form:form>
	<sys:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
				<th>书名</th>
				<th>出版日期</th>
				<th>出版社</th>
				<th>封面</th>
				<th>页数</th>
				<th>作者</th>
				<th>价格</th>
				<th>操作</th>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${page.list}" var="book">
			<tr>
				<td><a href="${ctx}/book/form?id=${book.id}">
					${book.bookname}
				</a></td>
				<td>
					<fmt:formatDate value="${book.createtime}" pattern="yyyy-MM-dd"/>
				</td>
				<td>
					${book.press}
				</td>
				<td>
					 <img src="${ctx}/book/download?id=${book.id}" style="width:130px;height:150px;" />					
				</td>
				
				<td>
					${book.bookpage}
				</td>
				<td>
					${book.author}
				</td>
				<td>
					${book.money}
				</td>
				<td>
    				<a href="${ctx}/book/form?id=${book.id}">修改</a>
					<a href="${ctx}/book/delete?id=${book.id}" onclick="return confirmx('确认要删除该Book吗？', this.href)">删除</a>
				</td>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>